window.onload = function(){
    // alert(888)  

    let search = document.querySelector('.search');
    let list = document.querySelector('.result-list');
    // alert('sad')
    search.addEventListener('focus', function () {
    
        // 显示下拉菜单
        list.style.display = 'block';
        
        // 文本框变色
        this.classList.add('.search');
    })
    search.addEventListener('blur', function () {
        // 隐藏下拉菜单;
        list.style.display = 'none';
        // 文本框去色
        this.classList.remove('.search');
    })
}